baubs git
Commit abf7b9a67fa22b64d14a96fff71654e2352aa4e6
Parents : 8c3e177
Author : Jan-Henrik Bruhn <hi@jhbruhn.de>
Date : 2025-12-13T23:38:13+01:00
fix: Resolve TypeScript build errors in PatternCanvas and imports
- Fix PenData import to use correct source (types/machine instead of penParser)
- Add explicit return type annotations for map callbacks in PatternCanvas
- Add parentheses around arrow function parameters to satisfy linter
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changes
2 files changed, 6 insertions(+), 5 deletions(-)
Diff
diff --git a/src/components/PatternCanvas.tsx b/src/components/PatternCanvas.tsx
index c9ab905..c7cdbdb 100644
--- a/src/components/PatternCanvas.tsx
+++ b/src/components/PatternCanvas.tsx
@@ -292,11 +292,11 @@ export function PatternCanvas() {
}}
>
<Stitches
- stitches={pesData.penStitches.stitches.map((s, i) => {
+ stitches={pesData.penStitches.stitches.map((s, i): [number, number, number, number] => {
// Convert PEN stitch format {x, y, flags, isJump} to PES format [x, y, cmd, colorIndex]
const cmd = s.isJump ? 0x10 : 0; // MOVE flag if jump
const colorIndex = pesData.penStitches.colorBlocks.find(
- b => i >= b.startStitch && i <= b.endStitch
+ (b) => i >= b.startStitch && i <= b.endStitch
)?.colorIndex ?? 0;
return [s.x, s.y, cmd, colorIndex];
})}
@@ -315,10 +315,10 @@ export function PatternCanvas() {
<Group x={localPatternOffset.x} y={localPatternOffset.y}>
<CurrentPosition
currentStitchIndex={sewingProgress.currentStitch}
- stitches={pesData.penStitches.stitches.map((s, i) => {
+ stitches={pesData.penStitches.stitches.map((s, i): [number, number, number, number] => {
const cmd = s.isJump ? 0x10 : 0;
const colorIndex = pesData.penStitches.colorBlocks.find(
- b => i >= b.startStitch && i <= b.endStitch
+ (b) => i >= b.startStitch && i <= b.endStitch
)?.colorIndex ?? 0;
return [s.x, s.y, cmd, colorIndex];
})}
diff --git a/src/utils/patternConverterClient.ts b/src/utils/patternConverterClient.ts
index 30496c8..2ac46ec 100644
--- a/src/utils/patternConverterClient.ts
+++ b/src/utils/patternConverterClient.ts
@@ -1,6 +1,7 @@
import type { WorkerMessage, WorkerResponse } from '../workers/patternConverter.worker';
import PatternConverterWorker from '../workers/patternConverter.worker?worker';
-import { parsePenData, type PenData } from './penParser';
+import { parsePenData } from './penParser';
+import type { PenData } from '../types/machine';
export type PyodideState = 'not_loaded' | 'loading' | 'ready' | 'error';
Served by rngit 1.3.3 - Generated in 0.04s